package com.ldzl.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 采购订单详情表
 * @TableName ck_purchase_order_line
 */
@TableName(value ="ck_purchase_order_line")
@Data
public class CkPurchaseOrderLine implements Serializable {
    /**
     * 订单详情ID
     */
    @TableId(type = IdType.AUTO)
    private Long line_id;

    /**
     * 采购订单ID
     */
    private Long po_id;

    /**
     * 货物编号
     */
    private String goods_code;

    /**
     * 货物名称
     */
    private String goods_name;

    /**
     * 规格型号
     */
    private String stock_sfn;

    /**
     * 单位名称
     */
    private String unit_name;

    /**
     * 采购数量
     */
    private BigDecimal quantity_num;

    /**
     * 待到货数量
     */
    private BigDecimal wait_num;

    /**
     * 到货数量
     */
    private BigDecimal arrived_num;

    /**
     * 待上架数量
     */
    private BigDecimal treat_list_num;     // 待上架数量

    /**
     * 已上架数量
     */
    private BigDecimal list_num;     // 以上架数量


    /**
     * 父分类id
     */
    private Long material_classification_id;

    /**
     * 子分类id
     */
    private Long material_subcategory_id;

    /**
     * 仓库ID
     */
    private Long warehouse_id;

    /**
     * 仓库名称
     */
    private String warehouse_name;

    /**
     * 单价
     */
    private BigDecimal unit_price;

    /**
     * 总价
     */
    private BigDecimal total_price;

    /**
     * 交货日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date delivery_date;

    /**
     * 批次编号
     */
    private String batch_code;

    /**
     * 订单详情状态（运输中，已到货）
     */
    private String status;

    /**
     * 备注
     */
    private String remark;

    /**
     * 创建者
     */
    private String create_by;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date create_time;

    /**
     * 更新者
     */
    private String update_by;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date update_time;

    /**
     * 删除标志（0代表存在 1代表删除）
     */
    private String is_delete;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CkPurchaseOrderLine that = (CkPurchaseOrderLine) o;
        return po_id == that.po_id;
    }

    @Override
    public int hashCode() {
        return Objects.hash(po_id);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", line_id=").append(line_id);
        sb.append(", po_id=").append(po_id);
        sb.append(", goods_code=").append(goods_code);
        sb.append(", goods_name=").append(goods_name);
        sb.append(", stock_sfn=").append(stock_sfn);
        sb.append(", unit_name=").append(unit_name);
        sb.append(", quantity_num=").append(quantity_num);
        sb.append(", wait_num=").append(wait_num);
        sb.append(", arrived_num=").append(arrived_num);
        sb.append(", material_classification_id=").append(material_classification_id);
        sb.append(", warehouse_id=").append(warehouse_id);
        sb.append(", warehouse_name=").append(warehouse_name);
        sb.append(", unit_price=").append(unit_price);
        sb.append(", total_price=").append(total_price);
        sb.append(", delivery_date=").append(delivery_date);
        sb.append(", batch_id=").append(batch_code);
        sb.append(", status=").append(status);
        sb.append(", remark=").append(remark);
        sb.append(", create_by=").append(create_by);
        sb.append(", create_time=").append(create_time);
        sb.append(", update_by=").append(update_by);
        sb.append(", update_time=").append(update_time);
        sb.append(", is_delete=").append(is_delete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}